Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix max length for static option values #1655

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

xoob
Copy link
Contributor

@xoob xoob commented Feb 15, 2025

Summary

According to the docs, this property accepts a maximum length of 150 chars whereas the SDK enforces 75.

value: (String) A unique string value that will be passed to your app when this option is chosen. Maximum length for this field is 150 characters.

Without this fix, we can get validation errors:

slack_sdk.errors.SlackObjectFormationError: value attribute cannot exceed 75 characters

Testing

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

According to the docs, this property accepts a maximum length of 150 chars whereas the SDK enforces 75.

 - https://api.slack.com/reference/block-kit/composition-objects#option

> `value`: (String) A unique string value that will be passed to your app when this option is chosen. Maximum length for this field is 150 characters.

Without this fix, we can get validation errors:

```
slack_sdk.errors.SlackObjectFormationError: value attribute cannot exceed 75 characters
```
Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.36%. Comparing base (f3be63f) to head (8a1e4ef).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1655      +/-   ##
==========================================
+ Coverage   85.33%   85.36%   +0.03%     
==========================================
  Files         113      113              
  Lines       12802    12802              
==========================================
+ Hits        10924    10928       +4     
+ Misses       1878     1874       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seratch seratch added enhancement M-T: A feature request for new functionality web-client Version: 3x labels Feb 15, 2025
@seratch seratch added this to the 3.35.0 milestone Feb 15, 2025
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you; it seems the max length was changed recently

@hello-ashleyintech hello-ashleyintech merged commit d6c206a into slackapi:main Feb 17, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:signed enhancement M-T: A feature request for new functionality Version: 3x web-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants